
//这里注入的是ui.router
	var app = angular.module('myApp',[]);
	app.controller('Ctrol', ['$scope','$http', function($scope,$http){
		$http.get('gesmall')
		.then(function(res){
			$scope.haha = res.data.lists
			$scope.arr = res.data;
				console.log($scope.arr);

			$scope.img = $scope.arr.pg.faceUrl;
			$scope.name = $scope.arr.pg.nick;
			$scope.name = $scope.arr.pg.nick;
			$scope.xin = $scope.arr.pro.star;
			$scope.di  = $scope.arr.pg.addr;
			$scope.zan = $scope.arr.pg.isFollow;
			console.log($scope.zan);
			 console.log($scope.xin);
			 $scope.chu = function(value){
			 	value.cmtCount = true;

			 }
			  $scope.ru = function(value){
			 	console.log(value)
			 	value.cmtCount = false;

			 }
			 for (var i = 0;i<$scope.xin;i++){
			 	$('<img src="http://res.alltuu.com/static/images/starimg/star-on.png" class="cao">').appendTo($('#hehe'));
			 }
			  for (var i = 0;i<5-$scope.xin;i++){
			 		$('<img src="http://res.alltuu.com/static/images/starimg/star-off.png">').appendTo($('#hehe'));
			 }
			// angular.forEach($scope.xin,function(data,index,arr){
			// 	$('#hehe').html('<img src="http://res.alltuu.com/static/images/starimg/star-on.png" class="cao">')
				
			// })
			// angular.forEach(5-$scope.xin,function(data,index,arr){
			// 	$('<img src="http://res.alltuu.com/static/images/starimg/star-off.png">').appendTo($('#hehe'));
			// })
			// 错误的思路方向
		})
	}])